﻿

#pragma once

#include <d3dx9-dynamic-load/d3dx9_dynamic_load.h>

#include <stdlib.h>
#include <stdarg.h>

#include <assert.h>

#pragma warning(push)
#pragma warning(disable : 4290)

namespace d3dx9_dynamic_load
{


	ID3DXSprite* CreateSprite(IDirect3DDevice9* const device,
			CD3DX9_Dll_Loader* const loader) throw(HRESULT) ;

	class Sprite {
	public:
		ID3DXSprite* const m_pSprite;


		Sprite(IDirect3DDevice9* const device,
			CD3DX9_Dll_Loader* const loader) throw(HRESULT) : m_pSprite(CreateSprite(device, loader)) 
		{

		}

		virtual ~Sprite()
		{
			if(m_pSprite)
			{
				m_pSprite->Release();
				{
					ID3DXSprite** pp = const_cast<ID3DXSprite**>(&m_pSprite);
					*pp = NULL;
				}
			}
		}

	};


	//--------------------------------------------------------------

	namespace test
	{
		int  do_test_sprite_draw();
	}

}

#pragma warning(pop)
